package week5;

public class isPalindrome {
    public static boolean isPalindrome(int num) {
        if (num < 0){
            return false;
    }
        int original = num;
        int reverse = 0;

        while (num != 0){
            int digit = num % 10;
            reverse = reverse * 10 + digit;
            num = num / 10;
        }

        return original == reverse;
    }
}
